<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>性能分析详细报告</title>
    <style>
        body {
            margin: 0;
            padding: 20px;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background-color: #f5f5f5;
            color: #333;
            line-height: 1.6;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            padding: 30px;
        }
        .header {
            text-align: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 2px solid #eee;
        }
        .header h1 {
            margin: 0;
            color: #2196F3;
            font-size: 28px;
        }
        .section {
            margin-bottom: 30px;
            padding: 20px;
            background-color: #f8f9fa;
            border-radius: 6px;
        }
        .section h2 {
            margin-top: 0;
            color: #333;
            font-size: 20px;
            border-bottom: 2px solid #e0e0e0;
            padding-bottom: 10px;
        }
        .metrics-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }
        .metric-card {
            background-color: white;
            padding: 15px;
            border-radius: 6px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .metric-card h3 {
            margin: 0;
            color: #666;
            font-size: 14px;
            text-transform: uppercase;
        }
        .metric-card p {
            margin: 10px 0 0;
            font-size: 24px;
            font-weight: 500;
            color: #2196F3;
        }
        .bottleneck-list {
            margin-top: 20px;
        }
        .bottleneck-item {
            background-color: white;
            padding: 15px;
            margin-bottom: 15px;
            border-radius: 6px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .bottleneck-item:last-child {
            margin-bottom: 0;
        }
        .bottleneck-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        .bottleneck-title {
            font-weight: 500;
            color: #f57c00;
        }
        .bottleneck-type {
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 500;
        }
        .type-time {
            background-color: #e3f2fd;
            color: #1976d2;
        }
        .type-memory {
            background-color: #e8f5e9;
            color: #388e3c;
        }
        .type-complexity {
            background-color: #fff3e0;
            color: #f57c00;
        }
        .bottleneck-details {
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid #eee;
        }
        .bottleneck-details p {
            margin: 5px 0;
            color: #666;
        }
        .recommendation {
            margin-top: 10px;
            padding: 10px;
            background-color: #f5f5f5;
            border-radius: 4px;
        }
        .recommendation h4 {
            margin: 0;
            color: #333;
            font-size: 14px;
        }
        .recommendation p {
            margin: 5px 0 0;
            color: #666;
        }
        .footer {
            margin-top: 30px;
            padding-top: 20px;
            border-top: 2px solid #eee;
            text-align: center;
            color: #666;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>性能分析详细报告</h1>
        </div>
        
        <div class="section">
            <h2>性能指标概览</h2>
            <div class="metrics-grid">
                <div class="metric-card">
                    <h3>总执行时间</h3>
                    <p>{总执行时间}</p>
                </div>
                <div class="metric-card">
                    <h3>平均执行时间</h3>
                    <p>{平均执行时间}</p>
                </div>
                <div class="metric-card">
                    <h3>总内存使用</h3>
                    <p>{总内存使用}</p>
                </div>
                <div class="metric-card">
                    <h3>平均内存使用</h3>
                    <p>{平均内存使用}</p>
                </div>
            </div>
        </div>
        
        <div class="section">
            <h2>性能瓶颈分析</h2>
            <p>发现 {性能瓶颈数} 个性能瓶颈</p>
            <div class="bottleneck-list">
                <!-- 由JavaScript动态填充 -->
            </div>
        </div>
        
        <div class="footer">
            <p>生成时间: <span id="timestamp"></span></p>
        </div>
    </div>
    
    <script>
        // 设置生成时间
        document.getElementById('timestamp').textContent = new Date().toLocaleString();
        
        // 填充性能瓶颈信息
        const bottlenecks = {瓶颈详情};
        const bottleneckList = document.querySelector('.bottleneck-list');
        
        bottlenecks.forEach((bottleneck, index) => {
            const typeClass = 
                bottleneck.类型 === '执行时间' ? 'type-time' :
                bottleneck.类型 === '内存使用' ? 'type-memory' : 'type-complexity';
                
            const div = document.createElement('div');
            div.className = 'bottleneck-item';
            div.innerHTML = `
                <div class="bottleneck-header">
                    <span class="bottleneck-title">瓶颈 #${index + 1}</span>
                    <span class="bottleneck-type ${typeClass}">${bottleneck.类型}</span>
                </div>
                <div class="bottleneck-details">
                    <p><strong>节点:</strong> ${bottleneck.节点}</p>
                    <p><strong>描述:</strong> ${bottleneck.描述}</p>
                    <div class="recommendation">
                        <h4>优化建议</h4>
                        <p>${bottleneck.建议}</p>
                    </div>
                </div>
            `;
            
            bottleneckList.appendChild(div);
        });
    </script>
</body>
</html> 